//
//  CZQHomeVIPCommentCell.m
//  coachmanage
//
//  Created by 众拳科技 on 2018/3/22.
//  Copyright © 2018年 众拳科技. All rights reserved.
//

#import "CZQHomeVIPCommentCell.h"

@implementation CZQHomeVIPCommentCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        /**
         星数
         */
        CWStarRateView *starView = [[CWStarRateView alloc]initWithFrame:CGRectMake(kScreenWidth - 95, 25, 80, 16)];
        
        [self addSubview:starView];
        self.starView = starView;
        
        /**
         头像
         */
        UIButton *icinBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [icinBtn setImage:PlaceHold forState:UIControlStateNormal];
        icinBtn.layer.cornerRadius = 20;
        icinBtn.clipsToBounds = YES;
        [self addSubview:icinBtn];
        self.iconBtn = icinBtn;
        
        /**
         昵称
         */
        UILabel *nameLable = [UILabel new];
        nameLable.textColor = CSColorFromRGB(0x333333);
        nameLable.font = ProjectMidFont;
        nameLable.text = @"温柔阳光";
        [self addSubview:nameLable];
        self.nameLable = nameLable;
        
        /**
         时间擅长
         */
        UILabel *timeLable = [UILabel new];
        timeLable.textColor = CSColorFromRGB(0xbababa);
        timeLable.font = MidBigFont;
        timeLable.text = @"2017-11-09 | 减脂塑形";
        [self addSubview:timeLable];
        self.timeLable = timeLable;
        
        /**
         内容
         */
        UILabel *titleLable = [UILabel new];
        titleLable.textColor = CSColorFromRGB(0x333333);
        titleLable.numberOfLines = 0;
        titleLable.font = MidBigFont;
        titleLable.text = @"阿萨德法师法师法萨芬撒飞洒发放撒发顺丰撒地方盛大发售发发发发发发的萨芬";
        [self addSubview:titleLable];
        self.titleLable = titleLable;
        
        [self setConstraints];
        
    }
    return self;
}
-(void)setConstraints
{
    
    /**
     头像
     */
    [self.iconBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.left.mas_equalTo(self).offset(20);
        make.width.height.mas_equalTo(40);
        
    }];
    
    /**
     昵称
     */
    [self.nameLable mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.iconBtn);
        make.left.mas_equalTo(self.iconBtn.mas_right).offset(10);
        
    }];
    
    /**
     星数
     */
    [self.starView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.centerY.mas_equalTo(self.nameLable);
        make.right.mas_equalTo(self).offset(-15);
        make.height.mas_equalTo(16);
        make.width.mas_equalTo(80);
        
        
    }];
    
    
    /**
     时间擅长
     */
    [self.timeLable mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.nameLable.mas_bottom).offset(5);
        make.bottom.mas_equalTo(self.iconBtn);
        make.left.mas_equalTo(self.nameLable);
        
    }];
    
    /**
     内容
     */
    [self.titleLable mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.timeLable.mas_bottom).offset(15);
        make.bottom.mas_equalTo(self).offset(-15);
        make.left.mas_equalTo(self.nameLable);
        make.right.mas_equalTo(self.starView);
        
    }];
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
